const config = require('./config')
const db = require('./db')

// const sql = "update fs set ?"

// const { uuid, io, type, device, mount, share } = config.fs
// console.log(config.fs)

// 更改
// const sql = `
//   UPDATE fs
//   SET uuid = $uuid, io = $io, type = $type, device = $device, mount = $mount, share = $share`;

// 添加新条目
  const sql = `
  INSERT INTO fs (uuid, io, type, device, mount, share)
  VALUES ($uuid, $io, $type, $device, $mount, $share)`;

db.run(sql, {
  $uuid: config.fs.uuid,
  $io: config.fs.io,
  $type: config.fs.type,
  $device: config.fs.device,
  $mount: config.fs.mount,
  $share: config.fs.share,
  }, err => {
    if (err) return console.log(err.message)

    // console.log(this.changes) // undefined
    // if (this.changes !==1) return console.log("添加共享存储失败")
    console.log(this) // {}

    console.log('添加成功')

})